package com.company.service.impl;

import com.company.entity.Type;
import com.company.service.GetNovelTypesService;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class GetNovelTypesServiceImpl implements GetNovelTypesService {

    @Override
    public void execute() {
        Scanner input = new Scanner(System.in);
        List<Type> listType = new ArrayList<>();
        listType.add(new Type("言情","/Users/l/Desktop/yanqing.txt"));
        listType.add(new Type("武侠","/Users/l/Desktop/wuxia.txt"));
        while (true){
            System.out.println("---------------------------");
            System.out.println("0.退出登录");
            System.out.println("1.言情");
            System.out.println("2.武侠");
            System.out.println("---------------------------");
            switch (input.nextInt()){
                case 0:
                    StartServiceImpl startService = new StartServiceImpl();
                    startService.execute();
                    break;
                case 1:
                    GetNovelsServiceImpl getNovelsService = new GetNovelsServiceImpl();
                    getNovelsService.show(1);
                    break;
                case 2:
                    GetNovelsServiceImpl getNovelsService2 = new GetNovelsServiceImpl();
                    getNovelsService2.show(2);
                    break;
                default:
                    System.out.println("你的输入有误,请重新输入!");
                    break;
            }
        }
    }
}
